home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 252 / gemsrc / screen.def < prev    next >
Text File  |  1988-02-13  |  3KB  |  109 lines

  1. DEFINITION MODULE Screen;
  2.  
  3.    (* This module defines types and procedures associated with *)
  4.    (* the physical screen.                                     *)
  5.  
  6.  
  7.    TYPE Pixel = INTEGER;
  8.  
  9.    TYPE PixelCoordinate = RECORD
  10.       X : Pixel;
  11.       Y : Pixel
  12.    END;
  13.  
  14.    TYPE Area = RECORD
  15.       Width  : Pixel;
  16.       Height : Pixel
  17.    END;
  18.  
  19.    TYPE Box = RECORD
  20.       Origin : PixelCoordinate;
  21.       Size   : Area
  22.    END;
  23.  
  24.    TYPE BoxCorners = RECORD
  25.       UpperLeft  : PixelCoordinate;
  26.       LowerRight : PixelCoordinate
  27.    END;
  28.  
  29.    TYPE PossibleResolutions = ( LowRes, MediumRes, HighRes );
  30.  
  31.    TYPE ColorIndex = ( White,     Black,     Red,         Green,
  32.                        Blue,      Cyan,      Yellow,      Magenta,
  33.                        White2,    Black2,    LightRed,    LightGreen,
  34.                        LightBlue, LightCyan, LightYellow, LightMagenta );
  35.  
  36.    TYPE ClipStatus = ( ClippingOff, ClippingOn );
  37.  
  38.  
  39.    VAR PhysicalHandle : INTEGER;
  40.  
  41.       (* Screen device driver handle (id) *)
  42.  
  43.    VAR VirtualHandle : INTEGER;         
  44.  
  45.       (* Screen virtual workstation handle (id) *)
  46.  
  47.    VAR Resolution : PossibleResolutions;
  48.  
  49.       (* Indicates the type of monitor connected to the system. *)
  50.  
  51.    VAR WorkSpace : Box;
  52.  
  53.       (* Size of the available work space (screen area less menu bar). *)
  54.  
  55.    VAR CharacterArea : Area;
  56.  
  57.       (* Size of a single character cell. *)
  58.  
  59.    VAR Center : Box;
  60.  
  61.       (* This variable defines the smallest possible box located at *)
  62.       (* the center of the screen.                                  *)
  63.  
  64.  
  65.    PROCEDURE Open;
  66.  
  67.       (* Open the screen.  This routine must be invoked prior to *)
  68.       (* calling any GEM VDI or AES routines.  *)
  69.  
  70.  
  71.    PROCEDURE Close;
  72.  
  73.       (* Close the screen and deactivate the workstation.  This routine *)
  74.       (* should be called prior to termination of the main program.     *)
  75.  
  76.  
  77.    PROCEDURE SetClippingRectangle ( ClipFlag  : ClipStatus;
  78.                                     Rectangle : Box );
  79.  
  80.       (* Set the clipping rectangle to the boundaries specified *)
  81.       (* by Rectangle.                                          *)
  82.  
  83.  
  84.    PROCEDURE ContainsPoint ( Region : Box;
  85.                              Point  : PixelCoordinate ) : BOOLEAN;
  86.  
  87.       (* Return TRUE if the region encloses the point, or FALSE *)
  88.       (* otherwise.                                             *)
  89.  
  90.  
  91.    PROCEDURE ContainsRectangle ( Region    : Box;
  92.                                  Rectangle : Box ) : BOOLEAN;
  93.  
  94.       (* Return TRUE if the region encloses the rectangle, or FALSE *)
  95.       (* otherwise.                                                 *)
  96.  
  97.  
  98.    PROCEDURE Intersection ( Region1     : Box;
  99.                             Region2     : Box;
  100.                             VAR Overlap : Box ) : BOOLEAN;
  101.  
  102.       (* Calculate the intersection of the two regions.  If the two   *)
  103.       (* regions intersect, the overlapping region is placed in       *)
  104.       (* Overlap and TRUE is returned.  Otherwise, FALSE is returned. *)
  105.  
  106.  
  107. END Screen.
  108.  
  109.